package com.unism.util;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class SerialTools {
	
	// 反序列化对象
	
	public static String getSerial(Object object) throws IOException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ObjectOutputStream out = new ObjectOutputStream(baos);
		out.writeObject(object); // 写入customer对象
		out.close();
		return baos.toString();
	}

//	public static Object getObject(String str, Class<?> destClass) {
//		ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(str.getBytes()) );
//		destClass obj3 = (destClass) in.readObject(); // 读取customer对象
//		in.close();
//		return obj3
//	}

}
